﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using Telerik.Web.UI;

namespace EXAM.Windows
{
    public partial class frmListQ : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {

        }

        protected void dgvList_NeedDataSource(object sender, Telerik.Web.UI.GridNeedDataSourceEventArgs e)
        {
            DataSet dset = Session["dsTestLog"] as DataSet;
            dgvList.DataSource = dset.Tables["dtQuest"];
        }

        protected void dgvList_ItemCreated(object sender, Telerik.Web.UI.GridItemEventArgs e)
        {
            string sErr = "";
            if (e.Item is GridDataItem && e.Item.DataItem != null)
            {
                try
                {
                    DataSet dset = Session["dsTestLog"] as DataSet;
                    HyperLink closelink = (HyperLink)e.Item.FindControl("CloseLink");

                    DataRow row = ((DataRowView)e.Item.DataItem).Row;
                    int index = dset.Tables["dtQuest"].Rows.IndexOf(row);
                    closelink.Attributes["href"] = "#";
                    closelink.Attributes["onclick"] = "return returnToParent('"
                                                + index +//((int)row["Line"] - 1).ToString() +
                                               "')";

                }
                catch (System.Exception ex)
                {
                    sErr = ex.Message;
                }

            }
        }
    }
}
